import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-11-22
 * Time:23:35
 */
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner( System.in );

        int n = sc.nextInt();

        int[] A =  new int[n];

        for (int i = 0; i < n; i++) {

            A[i] = sc.nextInt();

        }
        int signal = 0;
        int lastSignal = 0;
        int count = 0;
        if(A.length == 1 || A.length == 2){
            count = 1;
        }
//        if(A[0] < A[1]){
//            signal = 1;
//            lastSignal = 1;
//            count++;
//        }else{
//            signal = 0;
//            lastSignal = 0;
//            count++;
//        }

        for (int i = 0; i < A.length-1; i++) {
            //升序
            if(A[i] < A[i+1]){
                signal = 1;
            }
            if(A[i] >= A[i+1]){
                signal = 0;
            }
            if(i == 0){

                lastSignal = signal;
                count++;
            }
            if(signal != lastSignal){

                count++;
                lastSignal = signal;
            }

        }
        System.out.println(count);

    }
}
